#include "stdafx.h"
#include "OpenTheFileBehavior.h"
#include "Program.h"
#include "OpenDocFile.h"
#include "OpenXMLFile.h"
#include "OpenPNGFile.h"
#include "TextEditor.h"
#include "PictureEditor.h"
#include "OpenBMPFile.h"

void UsePrograms(Program program1, Program program2)
{
    program1.OpenTheFile();
    program2.OpenTheFile();

    std::cout << "Change file formats" << std::endl;

    std::shared_ptr<OpenTheFileBehavior> openXMLFile(new OpenXMLFile());
    std::shared_ptr<OpenTheFileBehavior> openBMPFile(new OpenBMPFile());

    program1.SetOpenFileBehavior(openXMLFile);
    program2.SetOpenFileBehavior(openBMPFile);

    program1.OpenTheFile();
    program2.OpenTheFile();
}

int main(int argc, char * argv[])
{
    TextEditor textEditor;
    PictureEditor pictureEditor;

    UsePrograms(textEditor, pictureEditor);

	return 0;
}

